<!DOCTYPE html>
<html lang="en">
<head>
	<{include file="user/header.html"}>
	<title>学员中心-德安信会计在线教育平台</title>
    <link href="/static/public/webupload/webuploader.css" rel="stylesheet">
<link href="/static/public/webupload/style.css" rel="stylesheet">
</head>
<body>
	<div class="wrap">
		<!--star left-->
		<div class="column">
			<{include file="user/left_menu.html"}>
		</div>
		<div id="ContMianBox">
			<!--star子栏目-->
			<div class="sub-colum">
				<div class="tit">账户设置</div>
				<ul>
                <li class="curr"><a href="/user/setting/info">我的信息</a></li>
					     <li><a href="/user/setting/account">账户设置</a></li>
					<!-- <li><a href="/user/fenxiao/team">我的团队</a></li> -->
					
				</ul>
			</div>
			<!--end子栏目-->
			<!--end left-->
			<div class="container narrow">
				<!--star conter-->
				<div class="cetContent">
					<div class="tit p-lr20">
						<span class="curr">我的信息</span>
					</div>
					<!--star内容区域-->
					<div class="mainScroll">
                        <div class="mainContainer line-all">
                            <div class="tabMainCont">
                                <!--star 编辑基本信息-->
                                <div class="tabItem step-02">
                                    <input type="hidden" id="token" value="<{$token}>">
                                    <form action="/user/setting/info" method="post" class="layui-form">
                                        <div class="layui-form-item layui-form-text">
                                          <input type="hidden" id="token" value="<{'VIMG'|get_qiniu_token}>" />
                                          <label class="layui-form-label">头像</label>
                                          <div class="layui-input-block" style="margin-top: 5px;">
                                              <div id="uploader1" class="upload_box" style="float:left; width:420px;">
                                                  <div class="queueList">
                                                      <div id="dndArea1" class="placeholder dndArea">
                                                          <div id="filePicker1" class="filePicker"></div>
                                                          <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
                                                      </div>
                                                  </div>
                                                  <div class="statusBar" style="display:none;">
                                                      <div class="progress">
                                                          <span class="text">0%</span>
                                                          <span class="percentage"></span>
                                                      </div><div class="info"></div>
                                                      <div class="btns">
                                                          <div id="filePickerBut1" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
                                                      </div>
                                                  </div>
                                                  <div class="upload_img_input" input_name='head_image_url'></div>
                                              </div>
                                              <{if isset($user['head_image_url']) AND $user['head_image_url'] != ''}>
                                                  <div class="layui-inline" style="float:left;"><img src="<{$user['head_image_url']}>" style="max-height:175px;"/></div>
                                              <{/if}>
                                          </div>
                                      </div>
                                        
                                        <!-- <div class="layui-form-item">
                                            <label class="layui-form-label">头像：</label>
                                            <div class="layui-input-inline">
                                                <div class="p-tb10 line-all oh b-FFFFFF">
                                                    <ul class="upload_A uploader-list" id="fileList">
                                                        <{if isset($img_url)}>
                                                            <{foreach from=$img_url item=item}>
                                                                <li id="" class="file-item thumbnail">
                                                                    <img src="<{$item}>">
                                                                    <div class="info hide"></div>
                                                                    <input type="hidden" name="img_url[]" value="<{$item}>">
                                                                </li>
                                                                <{/foreach}>
                                                                    <{/if}>
                                                                        <li>
                                                                            <div id="filePicker">选择图片</div>
                                                                        </li>
                                                    </ul>
                                                </div>
                                                <{if isset($img_url_err)}>
                                                    <i class="layui-icon" style="font-size: 30px; color: red">&#x1007;</i>
                                                    <span class="tip" style=" padding:2px 5px;"><{$img_url_err}></span>
                                                    <{/if}>
                                                        <div class="layui-form-mid layui-word-aux"></div>
                                            </div>
                                        </div> -->
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">姓名：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="name" style="width: 500px;" value="<{if isset($student)}><{$student['name']}><{/if}>" placeholder="请输入姓名" required lay-verify="required" autocomplete="off" class="layui-input">
                                                <{if isset($title_err)}>
                                                    <i class="layui-icon" style="font-size: 30px; color: red">&#x1007;</i>
                                                    <span class="tip" style=" padding:2px 5px;"><{$title_err}></span>
                                                    <{/if}>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                        <div class="layui-inline">
                                          <label class="layui-form-label">生日</label>
                                          <div class="layui-input-inline">
                                            <input value="<{if isset($student)}><{$student['birthday']}><{/if}>" type="text" name="birthday" id="birthday" lay-verify="date" placeholder="yyyy-mm-dd" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})">
                                          </div>
                                        </div>

                                        <label class="layui-form-label">性别</label>
                                        <div class="layui-input-inline">
                                          <{if isset($student)}>
                                          <input type="radio" name="sex" value="1" title="男" <{if $student['sex']==1 }>checked=""<{/if}> >
                                          <input type="radio" name="sex" value="2" title="女" <{if $student['sex']==2 }>checked=""<{/if}> >
                                          <{else}>
                                          <input type="radio" name="sex" value="1" title="男" checked="">
                                          <input type="radio" name="sex" value="2" title="女">
                                          <{/if}>


                                        </div>
                                      </div>


                                      <div class="layui-form-item">
                                        <label class="layui-form-label">微信</label>
                                        <div class="layui-input-inline">
                                          <input value="<{if isset($student)}><{$student['wx']}><{/if}>" placeholder="请填写微信" type="text" name="wx" id="wx"   autocomplete="off" class="layui-input">
                                        </div>

                                        <div class="layui-inline">
                                          <label class="layui-form-label">QQ</label>
                                          <div class="layui-input-inline">
                                            <input value="<{if isset($student)}><{$student['qq']}><{/if}>" type="text" placeholder="请填写QQ号" name="qq" id="qq" autocomplete="off" class="layui-input">
                                          </div>
                                        </div>
                                      </div>


                                      <div class="layui-form-item">
                                        <label class="layui-form-label">学历</label>
                                        <div class="layui-input-inline">
                                          <select name="edu" id="edu" lay-filter="aihao" lay-verify="required">
                                            <option value=""></option>
                                            <{if isset($student)}>
                                            <option value="1" <{if $student['edu']==1 }>selected<{/if}> >高中</option>
                                            <option value="2" <{if $student['edu']==2 }>selected<{/if}> >大专</option>
                                            <option value="3" <{if $student['edu']==3 }>selected<{/if}> >本科</option>
                                            <option value="4" <{if $student['edu']==4 }>selected<{/if}> >研究生</option>
                                            <option value="9" <{if $student['edu']==9 }>selected<{/if}> >其他</option>
                                            <{else}>
                                            <option value="1" >高中</option>
                                            <option value="2" >大专</option>
                                            <option value="3">本科</option>
                                            <option value="4">研究生</option>
                                            <option value="9">其他</option>
                                            <{/if}>

                                          </select>
                                        </div>

                                        <label class="layui-form-label">是否在职</label>
                                        <div class="layui-input-inline">
                                          <select name="on_job" id="on_job" lay-filter="aihao" lay-verify="required">
                                            <option value=""></option>
                                            <{if isset($student)}>
                                            <option value="0" <{if $student['on_job']==0 }>selected<{/if}>>非在职</option>
                                            <option value="1" <{if $student['on_job']==1 }>selected<{/if}>>在职</option>
                                            <{else}>
                                            <option value="0">非在职</option>
                                            <option value="1" >在职</option>
                                            <{/if}>
                                          </select>
                                        </div>
                                      </div>


                                      <div class="layui-form-item">
                                        <label class="layui-form-label">上课时间</label>
                                        <div class="layui-input-block">
                                          <input type="checkbox" <{if $student.class_time != 'null' && isset($student) && in_array(0,json_decode($student['class_time']))}>checked<{/if}> name="class_time[]" value="0" title="不限">
                                          <input type="checkbox" name="class_time[]" <{if $student.class_time != 'null' && isset($student) && in_array(1,json_decode($student['class_time']))}>checked<{/if}> value="1" title="白天">
                                          <input type="checkbox" name="class_time[]" <{if $student.class_time != 'null' && isset($student) && in_array(2,json_decode($student['class_time']))}>checked<{/if}> value="2" title="晚上">
                                          <input type="checkbox" name="class_time[]" <{if $student.class_time != 'null' && isset($student) && in_array(3,json_decode($student['class_time']))}>checked<{/if}> value="3" title="周末">
                                          <input type="checkbox" name="class_time[]" <{if $student.class_time != 'null' && isset($student) && in_array(4,json_decode($student['class_time']))}>checked<{/if}> value="4" title="工作日">
                                        </div>
                                      </div>
                                      <div class="layui-form-item">
                                        <label class="layui-form-label">省市</label>
                                        <div class="layui-input-inline">
                                          <select name="province" id="province" lay-filter="province" lay-verify="required">
                                            <option value="">请选择省</option>
                                            <{foreach from=$province item=item }>
                                            <option value="<{$item['area_code']}>" <{if isset($student) && $student['province']==$item['area_code'] }>selected<{/if}> ><{$item['area_name']}></option>
                                            <{/foreach}>
                                          </select>
                                        </div>

                                       
                                        <div class="layui-input-inline">
                                          <select name="city" id="city" lay-filter="city" lay-verify="required">
                                            <option value="">请选择市</option>
                                            <{if isset($city)}>
                                            <{foreach from=$city item=item }>
                                            <option value="<{$item['area_code']}>" <{if isset($student) && $student['city']==$item['area_code'] }>selected<{/if}> ><{$item['area_name']}></option>
                                            <{/foreach}>
                                            <{/if}>
                                          </select>
                                        </div>

                                        <div class="layui-input-inline">
                                          <select name="district" id="district" lay-filter="district" lay-verify="required">
                                            <option value="">请选择区</option>
                                           <{if isset($district)}>
                                            <{foreach from=$district item=item }>
                                            <option value="<{$item['area_code']}>" <{if isset($student) && $student['district']==$item['area_code'] }>selected<{/if}> ><{$item['area_name']}></option>
                                            <{/foreach}>
                                            <{/if}>
                                          </select>
                                        </div>
                                      </div>

                                      <div class="layui-form-item">
                                        <label class="layui-form-label">住址</label>
                                        <div class="layui-input-block">
                                          <input lay-verify="required" value="<{if isset($student)}><{$student['address']}><{/if}>" type="text" placeholder="请输入详细住址，省、市、区、街道 " style="width: 500px;" name="address" id="address" pl autocomplete="off" class="layui-input">
                                        </div>
                                      </div>

                                      <div class="layui-form-item layui-form-text">
                                        <label class="layui-form-label">备注信息</label>
                                        <div class="layui-input-inline">
                                          <textarea name="remark" id="remark" style="width:460px;" placeholder="请输入备注内容" class="layui-textarea"><{if isset($student)}><{$student['remark']}><{/if}></textarea>
                                        </div>
                                      </div>
                                        <div class="layui-form-item">
                                            <div class="layui-input-block">
                                                <button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
                                                <button type="reset" class="layui-btn layui-btn-primary">取消</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <!--end 编辑基本信息-->
                            </div>
                        </div>
                    </div>
                    </div>
				</div>
			</div>
			<!--end内容区域-->
			
		</div>
		
		
	</div>

    <script type="text/javascript" src="/static/public/webupload/webuploader.js"></script>
        <script type="text/javascript" src="/static/public/webupload/upload.js"></script>
        <script>
        layui.use(['form', 'layedit', 'laydate'], function(){
          var form = layui.form()
          ,layer = layui.layer
          ,laydate = layui.laydate;

          //自定义验证规则
          form.verify({
            phone: function(value){
              if(!(/^1[34578]\d{9}$/.test(value))){
                return "手机号码有误，请重填";
              }
            }

          });

            var birthday = {
              min: laydate.now(-20000)
              ,max: laydate.now()
              ,istoday: false
              ,choose: function(datas){
                birthday.min = datas; //开始日选好后，重置结束日的最小日期
                birthday.start = datas //将结束日的初始值设定为开始日
              }
            };


            document.getElementById('birthday').onclick = function(){
              birthday.elem = this;
              laydate(birthday);
            }

          //监听提交
          form.on('submit(demo1)', function(data){
            
            var class_time =[];
            $('input[name="class_time[]"]:checked').each(function(){
              class_time.push($(this).val());
            });
            if(class_time.length==0){
              class_time = "";
            }
            if(class_time==""){
              layer.msg('请选择上课时间');
              return false;
            }
            
          });

          //校区
        form.on('select(province)',function(data){
            var ii = layer.load();
            var province_code = data.value;
            $("#city").html('<option value="">请选择城市</option>');
            form.render('select');
            $.ajax({
                type: "GET",
                url: "/user/setting/get_area_by_parent/"+province_code,
                dataType:"json",
                success: function(result){
                    var html ='';
                    $.each(result, function(i, obj) {
                        html += '<option value="'+obj.area_code+'">'+obj.area_name+'</option>';
                    });
                    $("#city").append(html);
                    form.render('select');
                    layer.close(ii);
                }
            });
        });

        form.on('select(city)',function(data){
            var ii = layer.load();
            var city_code = data.value;
            $("#district").html('<option value="">请选择区域</option>');
            form.render('select');
            $.ajax({
                type: "GET",
                url: "/user/setting/get_area_by_parent/"+city_code,
                dataType:"json",
                success: function(result){
                    var html ='';
                    $.each(result, function(i, obj) {
                        html += '<option value="'+obj.area_code+'">'+obj.area_name+'</option>';
                    });
                    $("#district").append(html);
                    form.render('select');
                    layer.close(ii);
                }
            });
        });
        


        });
</script>
</body>
</html>
